//
//  ListCell.m
//  Topic1
//
//  Created by 孙添凤 on 16/12/6.
//  Copyright © 2016年 孙添凤. All rights reserved.
//

#import "ListCell.h"
#import "Masonry.h"
#import "UIColor+CL.h"
@implementation ListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initIdentifier:(NSString *)identifer{
    self=  [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer];
    if(self){
        UIView *superView = [self createUI];
        [self.contentView addSubview:superView];
        UIView *superview = self.contentView;
        UIEdgeInsets edge = UIEdgeInsetsMake(0, 0, 0, 0);
        [superView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(superview).insets(edge);
        }];
        
    }
    return self;
}

-(UIView *)createUI{
    UIView *baseView = [[UIView alloc]init];
    _la =[[UILabel alloc]init];
    [baseView addSubview:_la];
    _la.text = @"gogog";
    [_la sizeToFit];
    [_la mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(baseView.mas_left).offset(20);
        make.centerY.equalTo(baseView.mas_centerY);
    }];
    _la.textColor = [UIColor colorWithHex:0x6f6f6f];
    
    _textView =[[CustomTextView alloc]init];
    [baseView addSubview:_textView];
    [_textView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(baseView.mas_right).offset(-20);
        make.centerY.equalTo(baseView.mas_centerY);
        make.top.equalTo(baseView.mas_top).offset(16);
        make.height.equalTo(@(25));
        make.width.equalTo(@(200));
    }];
    _textView.placeholder = @"请填写";
    
    //    [_btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    return baseView;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
